﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.Odbc;
using Gestion_Api.AccesoDatos;
using System.Data.SqlClient;

namespace Escuela
{
    public partial class cusrsosAlumnos : Form
    {
        int idAlumno;
        public cusrsosAlumnos(int idAlumno, string nombre, string apellido)
        {
            InitializeComponent();
            this.maskedNroAl.Text = idAlumno.ToString();
            this.txtNom.Text = nombre;
            this.txtApe.Text = apellido;
            this.idAlumno = idAlumno;
        }


        private void cusrsosAlumnos_Load(object sender, EventArgs e)
        {
            this.cargarData2(); 
        }
        private void cargarData2()
        {


            
            string query = null;
            
            DataTable dt = new DataTable();
            AccesoDB ac = new AccesoDB();
            query = "coop_alumno_ver_cursos " + this.idAlumno;
            SqlCommand command = new SqlCommand();
            //command.Connection = connection;
            command.CommandText = query;
            command.CommandType = CommandType.Text;
            dt = ac.execDT(command);

            this.dataGridView1.DataSource = dt;
            
        }

        private void Cursos_Click(object sender, EventArgs e)
        {

        }

        private void Cerrar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
